<style lang="scss" scoped>
@import "@/assets/css/index";

.iconImg {
  width: 100%;
  margin-top: 80px;
  overflow: hidden;
  text-align: center;
  img {
    width: 140px !important;
    height: 140px;
  }
}
.applyResult {
  @include page();
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  text-align: center;
  .result {
    margin-top: 30px;
    color: #16d17b;
    font-size: 1.6rem;
  }
  .reason {
	  margin-top: 30px;
	  color: #aaaa7f;
	  font-size: 1.2rem;
  }
  .desc {
    margin-top: 10px;
    // color:$color2;
    .text {
      color: #16d17b;
    }
  }
  .btnBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.6rem;
    margin-top: 0rem;
    .btn1 {
      flex: 1;
      margin-right: 1rem;
    }
    .btn2 {
      flex: 1;
      margin-left: 1rem;
    }
  }
}
</style>
<template>
  <div class="applyResult">
    <div>
      <div class="iconImg">
        <img src="../../assets/img/fail.png" />
      </div>
      <div>
        <div class="result">申请被驳回</div>
		<div class="reason">请联系负责人了解原因 {{promoterConfig.mobile||''}}</div>
      </div>
    </div>
    <div class="btnBox">
      <div class="btn1">
        <van-button
          round
          plain
          type="info"
          style="width: 100%"
          @click="toViewReplace('/promoter')"
          >返回推广员主页</van-button
        >
      </div>
    </div>
  </div>
</template>

<script>
import { myMixins } from "@/assets/js/mixins.js";
import { mapGetters,mapActions } from 'vuex'
export default {
  name: "applyResult",
  mixins: [myMixins],
  data() {
    return {
      // activity_id:'',
      openid: "",
      order_id: "",
      result: "核销中...",
    };
  },
  computed: {
  	...mapGetters(['promoterConfig'])
  },
  mounted() {
    const _this = this;
    // _this.activity_id = _this.$route.params.activity_id;
    // alert('url:'+location.href)
    _this.openid = localStorage.getItem("COPENID");
    // alert('_this.openid:'+_this.openid)
    // alert('_this.order_id:'+_this.order_id)
	if(!this.promoterConfig){
		this.GET_promoterConfig()
	}
  },
  methods: {
	...mapActions(['GET_promoterConfig']),
    // 核销接口
    verificationItem() {
      let params = {
        openid: this.openid,
        order_id: this.order_id,
      };
      this.$request.verificationItem(params).then((res) => {
        // alert("res:"+JSON.stringify(res))
        if (res.ret == 400) {
          this.result = res.msg || "重复核销或核销失败";
          this.$forceUpdate();
          // alert("res.msg:" + res.msg)
          // alert("您已核销")
          // window.close();
        } else if (res.ret == 200) {
          this.result = "核销成功";
          // alert("核销成功")
          // window.close();
        }
      });
    },
  },
};
</script>